Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Use {SURVEYURL} in TWIG Theme Limesurvey 3.15

  • Heinrich
  • Heinrich's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177732 by Heinrich
Hello,

I'm running Limesurvey 3.15 and would like to set up a token based survey including open registration.

When participants register they type in their name + emai laddress and then get redirected to a page where their name + email address is displayed + a short message that they will receive an email soon with the link to the survey.
I already found out how to change that short message. However, what I would like to add is the link to the survey which is sent out via email such that participants can click on the link to directly answer the survey.
In Limesurvey 2.7 I think that was possible using the placeholder {SURVEURYL}. In LS 3.15 with TWIG files, I think that using that term is not possible anymore. What I could already include was the name of the survey or the name of the admin of the survey. Yet, I did not find a possibility yet to include the token based link.

Any help is highly appreciated.

Thank you.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177738 by holch
I am not sure, but because of the logic I don't think it was ever possible. Because {surveyurl} does not contain the token, as far as I know. But if it is a token based survey, you need the token to be able to enter the survey.

I might be mistaken though.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177739 by holch
In any way, if someone can participate without receiving the email, what is the point of the registration? You could just type any email and still would be able to participate. If that is what you want, you could just include 3 questions at the beginning of the survey that ask for name, lastname and email, couldn't you?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Heinrich
  • Heinrich's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177740 by Heinrich
Replied by Heinrich on topic Use {SURVEYURL} in TWIG Theme Limesurvey 3.15
Thank you for your Response. As far as I know, surveyurl does include the token.

We still need the Registration form because participants can then come back later and proceed the survey, made possible by the token.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177742 by tpartner
Replied by tpartner on topic Use {SURVEYURL} in TWIG Theme Limesurvey 3.15
You can place this at the end of your twig file to see what survey info values are available:

Code:
{{ dump(aSurveyInfo) }}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Heinrich
The topic has been locked.
  • Heinrich
  • Heinrich's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177745 by Heinrich
Replied by Heinrich on topic Use {SURVEYURL} in TWIG Theme Limesurvey 3.15
Thank you. I included that code, however, nothing is shown on the registration page. I also cleared the asset cache, but still no luck.
Anyways, I found the answer based on this post here: www.limesurvey.org/es/comunidad/foros/in...ions-from-2-x-to-3-x
The code is: {{ processString('{SURVEYURL}') }}

Will that still be working in LS 4.x?
The topic has been locked.
  • Heinrich
  • Heinrich's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177747 by Heinrich
Replied by Heinrich on topic Use {SURVEYURL} in TWIG Theme Limesurvey 3.15
Just a quick extension: With {{SURVEYURL}} no self-generated links with the "<a>" tag of HTML can be generated. That is why @@SURVEYURL@@ exists which only creates the link but without the "<a>" tag. However, @@SURVEYURL@@ does not work with TWIG files.

Therefore, I've created a workaround. The result looks like this:

<a href="https://URL-OF-YOUR-DOMAIN/index.php/{{ processString(aSurveyInfo.sid) }}/lang/LANGUAGE-OF-YOUR-STUDY-SUCH-AS-DE OR EN/token/{{ processString('{TOKEN}') }}">Please click here to be redirected to the survey

With {{ processString(aSurveyInfo.sid) }} the SID of the survey is processed and with {{ processString('{TOKEN}') }} the token of the participant is processed. When clicking on the link he/she will be immediately redirected to the survey.


Besides that workaround: Is there any equivalent of SURVEYURL in TWIG? Again, I was not able to process the dump-command. This did not give me any results - neither did it give me any error.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose